<?php 
namespace Home\Controller;
use HDPHP\Library\Controller;
/*
 * 
 * 前台搜索控制器->继承公共控制器
 */

class SearchController extends CommonController {	
	/*
	 * 注册默认方法 
	 */
	public function index(){
//		z($_POST);
		//获得提问表数据
			$Search=isset($_POST['search_content'])?$_POST['search_content']:NULL;
			$Searchsql="SELECT * FROM hd_ask WHERE content like '%$Search%'";
			$SearchData=M()->query($Searchsql);
		//把提问表数据输出到前台	
			$this->assign('SearchData',$SearchData);
//			z($SearchData);
		
		
		if($SearchData==NULL){
				echo "没有找到相关信息";
			}
		//载入搜索页面
		$this->display();
		
	}
	


}